
#ifndef _TTG_THREADS_ATOMICVALUE_
#define _TTG_THREADS_ATOMICVALUE_
#include "Common/Definitions.h"

#include "windows.h"

namespace ttg_internal
{
	namespace threads
	{
		//Contains atomic value, which can be safly used in diffrent threads.
		class AtomicInt
		{
			public:
				//Returns current value.
				virtual int get() = 0;
				//Sets value.
				virtual void set(int value) = 0;
				//Exchanges given value with current.
				virtual int exchange(int value) = 0;
				//Increments value by one.
				virtual int inc() = 0;
				//Dicrements value by one.
				virtual int dec() = 0;
				//Increments value by value.
				virtual int add(int value) = 0;
				virtual ~AtomicInt()
				{ /*nothing*/ }
		};
	}
}

#include "Win32/Win32AtomicValues.h"

#endif
